﻿    <script type="text/javascript">
        $(document).ready(function () {
            var p = new singlepage();
            p.c = "Way.Bus.WMS.ST.Controllers.Custemer.MaterialsController";
            p.applyTo = "t1";
            p.onCommandClick = function (command, form, item) {
                if (command == "add") {
                    form.setform("BATCH", "1");
                    form.setform("SEQUENCECODE", "1");
                    form.setform("STATUS", "0");
                    form.setform("STOREAMOUNT", "1");
                    form.setform("LOWESTSTOCK", "1");
                }
            }
            p.onSaveing = function (command, item) {
                if (command == "add") {
                    
                }
            }
            p.init();
        });

        function SetDisable(data) {
            window.MaterialCode = data.item.MATERIALCODE;
            $("#t2").dialog({
                title: "冻结" + data.item.MATERIALNAME + "",
                width: 400,
                height: 220,
                maximizable: false,
                cache: false,
                shadow: true,
                modal: true,
                content:""+data.item.ID+""
            });

        }
        function import1(data) {
            try {
                $('<div id="d2"><div id="d3"/></div>').appendTo($("#temp"));
                var p1 = new datasource();
                p1.c = "Way.Bus.Controllers.ExcelDRController";
                p1.applyTo = "d3";
                window.ddata = data;
                window.pdata = p1;
                p1.init();

                $('#d2').dialog({
                    title: "导入数据",
                    collapsible: false,
                    resizable: false,
                    width: 700,
                    height: 400,
                    cache: false,
                    href: "Views/manager/Exceldr.htm",
                    onClose: function () {
                        $(this).panel('destroy');
                        $("#temp").empty();
                        window.ddata = null;
                    }
                });
            } catch (e) {

            }
        }
    </script>
<div id="t1"></div>
<div id="t2">

</div>